package com.justnow.offer.argstransfer;

/**
 * @author justnow
 * Created on 2020-09-05
 * Description
 */
public class Demo04 {
    public static void main(String[] args) {
        String s = new String("aaa");
        System.out.println("原始字符串s的hashcode值：" + s.hashCode());
        change(s);
        System.out.println("调用方法后s的值" + s);
    }

    public static void change(String s1) {
        System.out.println("方法中s1的初值" + s1);
        System.out.println("方法中s1的hashcode:" + s1.hashCode());
        s1 = s1 + "bbb";
        System.out.println("方法中s1修改之后的值" + s1);
        System.out.println("方法中s1修改之后的hashcode:" + s1.hashCode());
    }

}
